package com.bookstore.service.impl;

import com.bookstore.domain.ShoppingCart;
import com.bookstore.mapper.ShoppingCartMapper;
import com.bookstore.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {
    @Autowired
    private ShoppingCartMapper mapper;
    @Override
    public List<ShoppingCart> findAllByUid(Integer uid) {
        return mapper.findAllByUid(uid);
    }

    @Override
    public ShoppingCart findAllByUidAndBid(Integer uid, Integer bid) {
        return mapper.findAllByUidAndBid(uid, bid);
    }

    @Override
    public int delShopping(Integer uid, Integer bid) {
        return mapper.delShopping(uid,bid);
    }

    @Override
    public int addCart(Integer bid, Integer uid, Integer count) {
        return mapper.addCart(bid,uid,count);
    }

    @Override
    public int delCart(Integer bid, Integer uid) {
        return mapper.delCart(bid,uid);
    }

    @Override
    public int upCount(Integer uid, Integer bid, Integer count) {
        return mapper.upCount(uid,bid,count);
    }
}
